<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div{
            width: 200px;
            height: 100px;
            background-color: green;
            position: absolute;
            left:100px;
            top:50px;
        }
    </style>
    <script src="jquery-1.12.2.js"></script>
    <script>
        $(function () {
            $("#btn").click(function () {
                //获取left和top的值--->都是数字类型
                //console.log($("#dv").offset().left);
                //console.log($("#dv").offset().top);
//                $("#dv").offset({"left":200,"top":200});
                $("#dv").animate({
                    "left": 200,
                    "top": 200
                })
            });
        });
    </script>
</head>
<body>
<input type="button" value="显示效果" id="btn"/>
<div id="dv"></div>
</body>
</html>